#include"Common.h"


// central cache本质上是由SpanList构成的哈希桶
class CentralCache
{
public:
    // 提供一个全局访问点
    static CentralCache* GetInstance()
    {
        return &_sInst;
    }

    //从central cache中获取若干个内存对象
    size_t FetchRangeObject(void*& start, void*& end, size_t batchNum, size_t size);

    //从SpanList或者page cache中获取一个非空的span
    Span* GetOneSpan(SpanList& list, size_t size);

private:
    CentralCache()
    {}

    CentralCache(const CentralCache&) = delete;

    static CentralCache _sInst;

private:
    SpanList _spanLists[NFREELISTS];
};
